using System;
using System.Collections.Generic;
using System.Text;
using System.Data.SqlClient ;

namespace TPAMainReportTools
{
    class Tools
    {
        public static SqlConnection GetConnection(string strConnectionString)
        {
            SqlConnection conn = new SqlConnection(strConnectionString);
            return conn;
        }

        public static void OpenConnection(SqlConnection tmpconn)
        {
            try
            {
                if (tmpconn .State !=System.Data.ConnectionState .Open )
                {
                    tmpconn.Open();
                }
            }
            catch
            {
            }
        }

        public static void CloseConnection(SqlConnection tmpconn)
        {
            try
            {
                if (tmpconn.State != System.Data.ConnectionState.Closed )
                {
                    tmpconn.Close();
                }
            }
            catch
            {
            }
        }
    }
}
